//
//  HNRegisterInfoModel.m
//  BestLearning
//
//  Created by 星道 on 17/5/16.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "HNRegisterInfoModel.h"

@implementation HNRegisterInfoModel

- (void)MgrWithPhone:(NSString *)Phone Child:(NSString *)Child Pwd:(NSString *)Pwd Invite:(NSString *)Invite Ident:(NSString *)Ident Provice:(NSString *)Provice ProviceCode:(NSString *)ProviceCode City:(NSString *)City CityCode:(NSString *)CityCode Area:(NSString *)Area AreaCode:(NSString *)AreaCode Leve:(NSString *)Leve LeveCode:(NSString *)LeveCode
{
    self.PhoneNumber = Phone;
    self.ChildAccout = Child;
    self.Password = Pwd;
    self.InviteCode = Invite;
    self.IdentifyingCode = Ident;
    self.Provice = Provice;
    self.ProviceCode = ProviceCode;
    self.City = City;
    self.CityCode = CityCode;
    self.Area = Area;
    self.AreaCode = AreaCode;
    self.Leve = Leve;
    self.LeveCode = LeveCode;
    
    if ([self.Provice isEqualToString:@"请选择您的省份"])
    {
        self.Provice = @"";
    }
    
    if ([self.City isEqualToString:@"请选择您的城市"])
    {
        self.City = @"";
    }
    
    if ([self.Area isEqualToString:@"请选择您的县区"])
    {
        self.Area = @"";
    }
    
    if ([self.Leve isEqualToString:@"请选择您孩子的年级"])
    {
        self.Leve = @"";
    }
    
    if (self.AreaCode == nil)
    {
        self.AreaCode = @"0";
    }
}



- (void)CheckUpWithComplete:(void (^)(BOOL))Complete
{
    if (
        [self.PhoneNumber stringByReplacingOccurrencesOfString:@" " withString:@""].length > 0 &&
        [self.ChildAccout stringByReplacingOccurrencesOfString:@" " withString:@""].length > 0 &&
        [self.Password stringByReplacingOccurrencesOfString:@" " withString:@""].length > 0    &&
        [self.IdentifyingCode stringByReplacingOccurrencesOfString:@" " withString:@""].length > 0 &&
        [self.Provice stringByReplacingOccurrencesOfString:@" " withString:@""].length > 0 &&
        [self.City stringByReplacingOccurrencesOfString:@" " withString:@""].length > 0 &&
        [self.Area stringByReplacingOccurrencesOfString:@" " withString:@""].length > 0
        )
    {
        Complete (YES);
    }
    else
    {
        Complete (NO);
    }
}
@end
